feat(scripts): custom-domain DNS automation and shared selectors#94
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: cf857bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile SummaryThis PR introduces custom-domain DNS automation for Edge Scripts: when a hostname lives in a Bunny DNS zone the CLI now detects it, offers to add/repoint a PULLZONE record, and then waits for propagation and issues SSL automatically — all in one guided flow. It also refactors script-selector boilerplate into shared
Confidence Score: 4/5Safe to merge after addressing the unsafe Id cast in the script picker's re-fetch path. The new packages/cli/src/commands/scripts/interactive.ts — the Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CLI as CLI (add / create)
participant BunnyDNS as Bunny DNS API
participant PullZone as Pull Zone API
participant DnsPoll as DNS Poll (system + 1.1.1.1/8.8.8.8)
User->>CLI: domains add shop.example.com [--wait]
CLI->>PullZone: addHostname(shop.example.com)
PullZone-->>CLI: hostnames + cnameTarget
alt Interactive / TTY
CLI->>BunnyDNS: findBunnyDnsZone(shop.example.com)
BunnyDNS-->>CLI: "match { zoneId, delegated }"
alt Zone found
CLI->>User: Point shop.example.com at this pull zone?
User-->>CLI: yes
alt "delegated == true"
CLI->>BunnyDNS: addPullZoneRecord / repointPullZoneRecord
BunnyDNS-->>CLI: ok
CLI->>PullZone: enableSsl (up to 3 attempts)
PullZone-->>CLI: certificate issued
CLI->>User: SSL certificate issued
else "delegated == false"
CLI->>BunnyDNS: addPullZoneRecord
BunnyDNS-->>CLI: ok
CLI->>User: Zone not delegated — update registrar NS
end
else Zone not found
CLI->>User: CNAME shop.example.com to system-hostname
CLI->>User: Wait for DNS and enable HTTPS now?
User-->>CLI: yes / --wait
loop Poll every 5s (max 10 min)
CLI->>DnsPoll: anyResolverPointsAt?
DnsPoll-->>CLI: true
end
CLI->>PullZone: enableSsl
PullZone-->>CLI: certificate issued
CLI->>User: SSL certificate issued
end
end
Reviews (10): Last reviewed commit: "autolink dns and scripts" | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
cli/packages/cli/src/core/hostnames/commands.ts
Lines 175 to 192 in a881759
When scripts domains add is run in automation as --wait --output json, this branch returns immediately after adding the hostname, before the later offerDnsWaitAndSsl path can poll DNS and issue the certificate. The command therefore exits successfully with ssl: false even though the user explicitly requested the wait/SSL flow; handle --wait before the JSON return or emit JSON after the wait result is known.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@greptile-apps re-review |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
No description provided.